<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib prefix="s"  uri="/struts-tags"%>
<%String this_path=request.getContextPath();%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns = "http://www.w3.org/1999/xhtml" dir="ltr" lang="zh-CN">
<head>
<meta name="decorator" content="none" />
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title>还款凭证</title>
<s:if test='type=="do"'>
<script type="text/javascript" src="<%=this_path%>/js/common/jquery.min.js"></script>
<script type="text/javascript" src="<%=this_path%>/js/common/jquery.PrintArea.js"></script>
</s:if>
<script type="text/javascript">
$(function(){
	$('.datepicker').datetimepicker({
		dateFormat: "yy-mm-dd",
		showTimepicker: false,changeMonth: true,changeYear: true
	});
});
</script>
</head>

<body>

<div id="dd">
<style type="text/css">
.tableprint{border-left:1px solid #000;padding:0;margin:0;}
.tableprint tr td{padding-left:3px;font-size:12px;border-bottom:1px solid #000;border-right:1px solid #000}
.border_top{border-top:1px solid #000;}
#moneybox{padding:0;margin:0}
#moneybox table{padding:0;margin:0;text-align:center}
#moneybox table tr{height:22px;}
#moneybox table tr td{width:22px;padding:0;margin:0;border:0;}
#moneybox table .first td{border-bottom:1px solid #000;border-right:1px solid #000}
#moneybox table .second td{border-right:1px solid #000}
#moneybox table .first .lasttd{border:0;border-bottom:1px solid #000}
#moneybox table .second .lasttd{border:0;}
input[type='text']{width:120px}
.datepicker{width:110px;background:#ddd;border:1px solid #999}
</style>
<table class="tableprint border_top" cellspacing="0" cellpadding="0">
  <tr style="height:2cm;" >
    <td colspan="4" align="center" >
    	<span style="font-size:16px;font-weight:bold">青岛市黄岛区瑞丰小额贷款公司</span><br />
    	<span style="font-size:16px;font-weight:bold">还款凭证</span><br />
    	<s:if test='type=="change"'>
    	收款日期：<s:text name="f.date.ymdc"><s:param value="printData.enddate"/></s:text>
    	</s:if>
		<s:elseif test='type=="changeahead"'>
		收款日期：<s:text name="f.date.ymdc"><s:param value="printData.enddate"/></s:text>
		</s:elseif>
    	<s:else>
    	收款日期：<s:text name="f.date.ymdc"><s:param value="printData.repaydate"/></s:text>
    	</s:else>
    </td>
  </tr>
  <tr style="height:0.5cm;">
    <td style="width:2cm;" >还款人 </td>
    <td style="width:5.7cm;">${printData.name}</td>
    <td style="width:2cm;">贷款人  </td>
    <td style="width:5.7cm;text-align:center">${printData.dname}</td>
  </tr>
  <tr style="height:0.5cm;">
    <td >存款账号   </td>
    <td >${printData.cbankaccount}</td>
    <td >贷款账号  </td>
    <td style="text-align:center">${printData.dcard}</td>
  </tr>
  <tr style="height:0.5cm;">
    <td >开户银行</td>
    <td >${printData.cbankname}</td>
    <td >开户银行 </td>
    <td style="text-align:center">${printData.dbank}</td>
  </tr>
  <tr style="height:1.2cm;">
    <td>本息合计<br />(大写)</td>
    <td colspan="2" >人民币：${printData.totalmoneychinese}</td>
    <td id="moneybox">
	<table cellspacing="0" cellpadding="0">
    <tr class="first">
    	<td>千</td><td>百</td><td>十</td><td>万</td><td>千</td><td>百</td><td>十</td><td>元</td><td>角</td><td class="lasttd">分</td>
    </tr>
<tr class="second"><s:iterator value="printData.totalmoneyarray" status="index" var="var">
<td>${var }</td>
</s:iterator>
</tr>
    </table>
    </td>
  </tr>
  <tr style="height:1.6cm;">
    <td colspan="4" style="font-size:14px;line-height:1.2">
收回 <span style="text-decoration:underline">&nbsp;&nbsp;&nbsp;&nbsp;<s:text name="f.date.ymdc"><s:param value="printData.startdate"/></s:text>&nbsp;&nbsp;&nbsp;&nbsp;</span>&nbsp;发放，
      <span style="text-decoration:underline">&nbsp;&nbsp;&nbsp;&nbsp;<s:text name="f.date.ymdc"><s:param value="printData.enddate"/></s:text>&nbsp;&nbsp;&nbsp;&nbsp;</span>&nbsp;&nbsp;到期的贷款；
<br /> 
 本金：￥<s:text name="f.money"><s:param value="printData.totalmoney"/></s:text> ；利息: ￥_________________________；<br /> 
该笔贷款尚欠本金 ：￥<s:text name="f.money"><s:param value="printData.balance"/></s:text> ；利息：￥_________________________；
    </td>
  </tr>
  <tr  style="height:1cm;">
    <td colspan="4"><p align="center" >上述还款项我公司已收妥。</p>
    <p align="center" >(公司财务章)</p>
    <p align="center"></p>
    <p align="center"></p></td>
  </tr>
  <tr  style="height:1.2cm;">
    <td colspan="4"></td>
  </tr>
</table>

</div>
<s:if test='type=="change"'>
<form action="creditPrint!printInChange" method="post" >
<input type="hidden" name="id" value="${id}"/>
<input type="hidden" name="backmethod" value="do"/>
还款金额：<input type="text" name="money" value="${printData.balance}" />
还款日期：<input type="text" name="thisdate" readonly="readonly" value="<s:text name="f.date.ymd"><s:param value="printData.enddate"/></s:text>" class="datepicker"/>
<input type="submit"  />
</form>
</s:if>
<s:elseif test='type=="changeahead"'>
<form action="creditPrint!printInChange" method="post" >
<input type="hidden" name="id" value="${id}"/>
<input type="hidden" name="backmethod" value="ahead"/>
还款金额：<input type="text" name="money" value="${printData.balance}" />
还款日期：<input type="text" name="thisdate" readonly="readonly" value="<s:text name="f.date.ymd"><s:param value="printData.enddate"/></s:text>" class="datepicker"/>
<input type="submit"  />
</form>
</s:elseif>
<s:elseif test='type=="sure"'>
应收账款：${printData.yingshou}
实收账款：${printData.shishou}
未收账款：${printData.balance}
还款日期：<s:text name="f.date.ymdc"><s:param value="printData.repaydate"/></s:text>
<input type="button" class="printrealsure" value="确认" />
<script type="text/javascript">
$(function(){ 
   	$(".printrealsure").click(function(){
   		$thisid=$(this).parent("td").attr("id");
   		MessageDialog("./creditIn!change?type=sure&id="+${id},"确认完成？","");
   	});
});  
</script>
</s:elseif>
<s:else>
<div id="button_area"><input type="button" id="print_btn" value="确认打印" /></div>
<script type="text/javascript">
$(function(){ 
    $("#print_btn").click(function(){
        $("#dd").printArea();
    });
});  
</script>
</s:else>
</body>
</html>